<extend name="Public/base"/>

<block name="body">

	<div class="main-title">
		<h2>商户信息</h2>
	</div>

    <div class="cf">
         <div class="fl">
            <!-- <input type="text" class="kballow" style="height:30px;border:1px solid #0099cc;padding-left:1em;" placeholder="请输入许可的用户手机号"> -->
            <button class="btn" onclick="javascript:history.back(-1);return false;">返 回</button>
            

        </div>
        <php>
            $LOAN_STATUS = C('LOAN_STATUS');
        </php>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">

            <div class="btn-group-click adv-sch-pannel fl">
                <input name="title" class="allow" value="" placeholder="请输入UID" type="text" style="height:30px;border:1px solid #0099cc;padding-left:1em">
                <button class="btn" id="allow"  style="float:right;height:30px;">确定允许该用户入驻口碑码</button>
            </div> 

        </div>
    </div>

	<div class="data-table table-striped" >
		<table style="font-size:14px;">
			<thead>
				<tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
					<th>ID</th>
					<th>用户UID</th>
                    <th>姓名</th>
                    <th >手机号码</th>
                    <th>身份证号码</th>
                    <th>授权状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<notempty name="_list">
				<volist name="_list" id="rows">
					<tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$rows['id']}" /></td>
                        
						<td>{$rows['id']}</td>
						<td>{$rows['uid']}</td>
                        <td>{$rows['name']}</td>
                        <td>{$rows['phone']}</td>
                        <td>{$rows['identify_No']}</td>
                            
                        <td>
                            <php>
                                if($rows['real_status']==0){
                                    echo '待审核';
                                }else{
                                    echo '已授权';
                                }
                            </php>
                        </td>
                        
						<td>

                            &nbsp;&nbsp;
							<a title="详细" href="{:U('koubei_view?id='.$rows['id'])}">详细</a>
						</td>
					</tr>
				</volist>
				<else/>
				<td colspan="14" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
			</tbody>
		</table>



	</div>

    <div class="page"  style="float:left;margin-right:300px;">{$_page}</div>
</block>

<block name="script">
    <link href="/Public/static/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <link href="/Public/static/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/Public/static/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="/Public/static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
    $(function(){

         Think.setValue("extend", {$info.extend|default=0});
//导航高亮
highlight_subnav('{:U('index')}');



        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var status = $("#sch-sort-txt").attr("data");
            var type   = $("#sch-sort-txt_type").attr("data");
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if(status != ''){
                query += '&status=' + status + "&" + query;
            }
            if(type != ''){
                query += '&type=' + type + "&" + query;
            }
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });




        /* 状态搜索子菜单 */
        $(".search-form").find(".drop-down1").hover(function(){
            $("#sub-sch-menu").removeClass("hidden");
        },function(){
            $("#sub-sch-menu").addClass("hidden");
        });
        $("#sub-sch-menu li").find("a").each(function(){
            $(this).click(function(){
                var text = $(this).text();
                $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
                $("#sub-sch-menu").addClass("hidden");
            })
        });

        $(".search-form").find(".drop-down_type").hover(function(){
            $("#sub-sch-menu_type").removeClass("hidden");
        },function(){
            $("#sub-sch-menu_type").addClass("hidden");
        });

        $("#sub-sch-menu_type li").find("a").each(function(){
            $(this).click(function(){
                var text = $(this).text();
                $("#sch-sort-txt_type").text(text).attr("data",$(this).attr("value"));
                $("#sub-sch-menu_type").addClass("hidden");
            })
        });
        $('#time-start').datetimepicker({
            format: 'yyyy-mm-dd',
            language:"zh-CN",
            minView:2,
            autoclose:true
        });

        $('#time-end').datetimepicker({
            format: 'yyyy-mm-dd',
            language:"zh-CN",
            minView:2,
            autoclose:true
        });




        $('.kouk').click(function(){
            obj = document.getElementsByClassName("ids");
            // console.log(obj)
            check_val = [];
            for(k in obj){
                if(obj[k].checked)
                    check_val.push(obj[k].value);
            }
            $.ajax({
                type:'post',
                data:{'ids':check_val},
                // dataType:'json',
                url:"index.php?m=admin&c=capital&a=kouk",
                success:function(m){
                    alert(m)
                        // alert("提交扣款人数："+ids+"，成功："+success+"，失败："+default+"。失败合同号："+ht+"对应失败原因："+error)
                }
            })
        })




        $('#allow').click(function(){

            var allow=$('.allow').val();
            // alert(allow)
            $.ajax({
                type:'post',
                url:"{:U('kbxx')}",
                data:{'uid':allow},
                success:function(m){
                    if(m==0){
                        alert('添加失败')
                    }else{
                        alert('添加成功')
                    }
                }
            })
        })












    })


</script>
</block>